# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

_gemname=mini_portile
pkgname=ruby-${_gemname}
pkgver=0.6.2
pkgrel=4
pkgdesc='Simple autoconf builder for developers'
url='https://github.com/flavorjones/mini_portile'
arch=('any')
license=('MIT')
depends=('ruby')
makedepends=('ruby-rdoc' 'ruby-rake')
options=('!emptydirs')
source=(https://github.com/flavorjones/mini_portile/archive/v${pkgver}/${pkgname}-v${pkgver}.tar.gz)
sha256sums=('359feeb4c18f172ea4eafc0ef0646b85787a6ce210733c6a58b85d54b46f4a13')
sha512sums=('7b9bd79d42af9aa146c21b59d1beaad623e0f981b8d849653e3f2f8bb69d986ffbf0661bf0867cb1ce0aee48ca6ff613b9e9f1cc4b280d85b27e9c8195d48a24')

build() {
  cd ${_gemname}-${pkgver}
  rake gem
}

package() {
  cd ${_gemname}-${pkgver}
  local _gemdir="$(gem env gemdir)"
  gem install --ignore-dependencies --no-user-install -i "${pkgdir}${_gemdir}" \
    -n "${pkgdir}/usr/bin" pkg/${_gemname}-${pkgver}.gem

  install -Dm 644 LICENSE.txt -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -Dm 644 README.rdoc History.txt -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 examples/* -t "${pkgdir}/usr/share/doc/${pkgname}/examples"

  rm "${pkgdir}/${_gemdir}/cache/${_gemname}-${pkgver}.gem"
}

# vim: ts=2 sw=2 et:
